//电影管理

var express = require('express');
var router = express.Router();
var sqlQuery = require('../../../module/sql');

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.render('admin/category/categoryadd')
});




router.post('/',async(req,res)=>{
  // console.log("------------------",req.body)
  // console.log("------------------",req.body.typeName)
  let typeName = req.body.typeName
  // console.log("------------------",typeName)
  let sqlStr = "insert into type (typeName,state) values(?,1)"
  await sqlQuery(sqlStr,[typeName])
  res.json({
      state:"ok",
      content:"添加成功"
    })
})




module.exports = router;
